<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>课程管理</title>
    <link rel="icon" type="image/x-icon" href="/img/favicon.jpg"/>
</head>
<link rel="stylesheet" href="https://qidian.gtimg.com/lulu/pure/css/common/ui/Input.css">
<!-- jquery-->
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js"></script>
<script src="/js/index.js"></script>
<link rel="stylesheet" href="/css/pure/pure-min.css">
<link rel="stylesheet" href="/css/index.css">
<style>
</style>
<body>
<!--导航栏-->
<div th:replace="common :: navbar"></div>
<!--中部统计数据-->
<div th:replace="common :: boxbar"></div>

<p style="margin-left: 10%;text-align: left;color: grey">
    <a th:if="${session.user.role == 2}" href="/modelList" class="p_button" >教学模块</a>
    <a th:if="${session.user.role == 2}" href="/myClass" class="p_button">我的班级</a>
    <a href="/teacher/lesson" class="p_button" style="color: #2a80eb">我的课程</a>
</p>

<section class="lesson_box" style="justify-content: left">
    <div th:each="info,infoStat : ${page.list}" class="lesson">
        <a th:href="@{/lessonInfo(id=${info.id})}">
            <img class="lesson_img" th:src="${info.imgUrl!=null?info.imgUrl:'/img/lo.png'}"  onerror="this.src='/img/default.jfif'"  >
        </a>
        <p class="lesson_p" th:text="${info.name}" style="font-size: 15px;color: black"></p>
        <p class="lesson_p" th:text="${info.remark}"></p>
    </div>
</section>


<!-- 底部分页 -->
<form id="form" style="display: flex;justify-content: center" action="/lesson" type="POST">
    当前页  （<a  th:text="${page.currentPage+1}"  />）
    <a style="color: #2a80eb" onclick="loadPage(- 1)" th:if="${page.currentPage > 0}">上一页</a>
    <a style="color: #2a80eb"  onclick="loadPage(1)" th:if = "${page.currentPage < (page.totalPage - 1)}">下一页</a>
    共      <a style="color: #f59b00"  th:text="${page.total}" />条|
    <a style="color: #f59b00"  th:text="${page.totalPage}" />页
    每页    <a style="color: #f59b00"  th:text="${page.pageSize}" />条
    <input type="hidden" name="pageSize" th:value="${page.pageSize}" />
    <input name="currentPage" id="currentPage" type="hidden" th:value="${page.currentPage}"  />
    <input name="flag" id="flag" type="hidden" value="0"   />
</form>

</body>
</html>